package com.zzyl.nursing.controller.member;


import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.serve.domain.NursingProject;
import com.zzyl.serve.service.INursingProjectService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@RestController
//@Controller
@RequestMapping("/member/orders/project")
public class MemberOrderController extends BaseController {

    @Autowired
    private INursingProjectService nursingProjectService;

    /**
     * 获取项目列表
     * @param
     * @return
    */
    @GetMapping("/page")
    @ApiOperation(value = "获取护理项目列表")
    public TableDataInfo<List<NursingProject>> pageNameAndStatus( Integer status, String name,Integer pageNum, Integer pageSize)
    {

        List<NursingProject> list = nursingProjectService.pageNameAndStatus(status,name,pageNum,pageSize);
        return getDataTable(list);
    }

    /**
     * 获取项目详情
     * @param id
     * @return
     */
   @GetMapping("/{id}")
    public AjaxResult getProjectById(@PathVariable Long id){
        return  AjaxResult.success( nursingProjectService.selectNursingProjectById(id));

   }

}
